Integrand size = 10, antiderivative size = 74 \[ \int x^2 \cot (a+b x) \, dx=-\frac {i x^3}{3}+\frac {x^2 \log \left (1-e^{2 i (a+b x)}\right )}{b}-\frac {i x \operatorname {PolyLog}\left (2,e^{2 i (a+b x)}\right )}{b^2}+\frac {\operatorname {PolyLog}\left (3,e^{2 i (a+b x)}\right )}{2 b^3} \]
[Out]
Time = 0.17 (sec) , antiderivative size = 74, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.500, Rules used = {3798, 2221, 2611, 2320, 6724} \[ \int x^2 \cot (a+b x) \, dx=\frac {\operatorname {PolyLog}\left (3,e^{2 i (a+b x)}\right )}{2 b^3}-\frac {i x \operatorname {PolyLog}\left (2,e^{2 i (a+b x)}\right )}{b^2}+\frac {x^2 \log \left (1-e^{2 i (a+b x)}\right )}{b}-\frac {i x^3}{3} \]
[In]
[Out]
Rule 2221
Rule 2320
Rule 2611
Rule 3798
Rule 6724
Rubi steps \begin{align*} \text {integral}& = -\frac {i x^3}{3}-2 i \int \frac {e^{2 i (a+b x)} x^2}{1-e^{2 i (a+b x)}} \, dx \\ & = -\frac {i x^3}{3}+\frac {x^2 \log \left (1-e^{2 i (a+b x)}\right )}{b}-\frac {2 \int x \log \left (1-e^{2 i (a+b x)}\right ) \, dx}{b} \\ & = -\frac {i x^3}{3}+\frac {x^2 \log \left (1-e^{2 i (a+b x)}\right )}{b}-\frac {i x \operatorname {PolyLog}\left (2,e^{2 i (a+b x)}\right )}{b^2}+\frac {i \int \operatorname {PolyLog}\left (2,e^{2 i (a+b x)}\right ) \, dx}{b^2} \\ & = -\frac {i x^3}{3}+\frac {x^2 \log \left (1-e^{2 i (a+b x)}\right )}{b}-\frac {i x \operatorname {PolyLog}\left (2,e^{2 i (a+b x)}\right )}{b^2}+\frac {\text {Subst}\left (\int \frac {\operatorname {PolyLog}(2,x)}{x} \, dx,x,e^{2 i (a+b x)}\right )}{2 b^3} \\ & = -\frac {i x^3}{3}+\frac {x^2 \log \left (1-e^{2 i (a+b x)}\right )}{b}-\frac {i x \operatorname {PolyLog}\left (2,e^{2 i (a+b x)}\right )}{b^2}+\frac {\operatorname {PolyLog}\left (3,e^{2 i (a+b x)}\right )}{2 b^3} \\ \end{align*}
Time = 0.59 (sec) , antiderivative size = 136, normalized size of antiderivative = 1.84 \[ \int x^2 \cot (a+b x) \, dx=\frac {i b^3 x^3+3 b^2 x^2 \log \left (1-e^{-i (a+b x)}\right )+3 b^2 x^2 \log \left (1+e^{-i (a+b x)}\right )+6 i b x \operatorname {PolyLog}\left (2,-e^{-i (a+b x)}\right )+6 i b x \operatorname {PolyLog}\left (2,e^{-i (a+b x)}\right )+6 \operatorname {PolyLog}\left (3,-e^{-i (a+b x)}\right )+6 \operatorname {PolyLog}\left (3,e^{-i (a+b x)}\right )}{3 b^3} \]
[In]
[Out]
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 197 vs. \(2 (62 ) = 124\).
Time = 0.35 (sec) , antiderivative size = 198, normalized size of antiderivative = 2.68
method | result | size |
risch | \(-\frac {i x^{3}}{3}+\frac {4 i a^{3}}{3 b^{3}}+\frac {2 i a^{2} x}{b^{2}}+\frac {\ln \left (1+{\mathrm e}^{i \left (b x +a \right )}\right ) x^{2}}{b}-\frac {2 i \operatorname {polylog}\left (2, -{\mathrm e}^{i \left (b x +a \right )}\right ) x}{b^{2}}+\frac {2 \operatorname {polylog}\left (3, -{\mathrm e}^{i \left (b x +a \right )}\right )}{b^{3}}+\frac {\ln \left (1-{\mathrm e}^{i \left (b x +a \right )}\right ) x^{2}}{b}-\frac {a^{2} \ln \left (1-{\mathrm e}^{i \left (b x +a \right )}\right )}{b^{3}}-\frac {2 i \operatorname {polylog}\left (2, {\mathrm e}^{i \left (b x +a \right )}\right ) x}{b^{2}}+\frac {2 \operatorname {polylog}\left (3, {\mathrm e}^{i \left (b x +a \right )}\right )}{b^{3}}-\frac {2 a^{2} \ln \left ({\mathrm e}^{i \left (b x +a \right )}\right )}{b^{3}}+\frac {a^{2} \ln \left ({\mathrm e}^{i \left (b x +a \right )}-1\right )}{b^{3}}\) | \(198\) |
[In]
[Out]
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 244 vs. \(2 (59) = 118\).
Time = 0.29 (sec) , antiderivative size = 244, normalized size of antiderivative = 3.30 \[ \int x^2 \cot (a+b x) \, dx=\frac {-2 i \, b x {\rm Li}_2\left (\cos \left (2 \, b x + 2 \, a\right ) + i \, \sin \left (2 \, b x + 2 \, a\right )\right ) + 2 i \, b x {\rm Li}_2\left (\cos \left (2 \, b x + 2 \, a\right ) - i \, \sin \left (2 \, b x + 2 \, a\right )\right ) + 2 \, a^{2} \log \left (-\frac {1}{2} \, \cos \left (2 \, b x + 2 \, a\right ) + \frac {1}{2} i \, \sin \left (2 \, b x + 2 \, a\right ) + \frac {1}{2}\right ) + 2 \, a^{2} \log \left (-\frac {1}{2} \, \cos \left (2 \, b x + 2 \, a\right ) - \frac {1}{2} i \, \sin \left (2 \, b x + 2 \, a\right ) + \frac {1}{2}\right ) + 2 \, {\left (b^{2} x^{2} - a^{2}\right )} \log \left (-\cos \left (2 \, b x + 2 \, a\right ) + i \, \sin \left (2 \, b x + 2 \, a\right ) + 1\right ) + 2 \, {\left (b^{2} x^{2} - a^{2}\right )} \log \left (-\cos \left (2 \, b x + 2 \, a\right ) - i \, \sin \left (2 \, b x + 2 \, a\right ) + 1\right ) + {\rm polylog}\left (3, \cos \left (2 \, b x + 2 \, a\right ) + i \, \sin \left (2 \, b x + 2 \, a\right )\right ) + {\rm polylog}\left (3, \cos \left (2 \, b x + 2 \, a\right ) - i \, \sin \left (2 \, b x + 2 \, a\right )\right )}{4 \, b^{3}} \]
[In]
[Out]
\[ \int x^2 \cot (a+b x) \, dx=\int x^{2} \cot {\left (a + b x \right )}\, dx \]
[In]
[Out]
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 257 vs. \(2 (59) = 118\).
Time = 0.32 (sec) , antiderivative size = 257, normalized size of antiderivative = 3.47 \[ \int x^2 \cot (a+b x) \, dx=-\frac {2 i \, {\left (b x + a\right )}^{3} - 6 i \, {\left (b x + a\right )}^{2} a + 12 i \, b x {\rm Li}_2\left (-e^{\left (i \, b x + i \, a\right )}\right ) + 12 i \, b x {\rm Li}_2\left (e^{\left (i \, b x + i \, a\right )}\right ) - 6 \, a^{2} \log \left (\sin \left (b x + a\right )\right ) + 6 \, {\left (-i \, {\left (b x + a\right )}^{2} + 2 i \, {\left (b x + a\right )} a\right )} \arctan \left (\sin \left (b x + a\right ), \cos \left (b x + a\right ) + 1\right ) + 6 \, {\left (i \, {\left (b x + a\right )}^{2} - 2 i \, {\left (b x + a\right )} a\right )} \arctan \left (\sin \left (b x + a\right ), -\cos \left (b x + a\right ) + 1\right ) - 3 \, {\left ({\left (b x + a\right )}^{2} - 2 \, {\left (b x + a\right )} a\right )} \log \left (\cos \left (b x + a\right )^{2} + \sin \left (b x + a\right )^{2} + 2 \, \cos \left (b x + a\right ) + 1\right ) - 3 \, {\left ({\left (b x + a\right )}^{2} - 2 \, {\left (b x + a\right )} a\right )} \log \left (\cos \left (b x + a\right )^{2} + \sin \left (b x + a\right )^{2} - 2 \, \cos \left (b x + a\right ) + 1\right ) - 12 \, {\rm Li}_{3}(-e^{\left (i \, b x + i \, a\right )}) - 12 \, {\rm Li}_{3}(e^{\left (i \, b x + i \, a\right )})}{6 \, b^{3}} \]
[In]
[Out]
\[ \int x^2 \cot (a+b x) \, dx=\int { x^{2} \cot \left (b x + a\right ) \,d x } \]
[In]
[Out]
Timed out. \[ \int x^2 \cot (a+b x) \, dx=\int x^2\,\mathrm {cot}\left (a+b\,x\right ) \,d x \]
[In]
[Out]